<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form name="f1">
      <p>
        city
        <select name="city">
          <option value="nj">南京</option>
          <option value="sh">上海</option>
          <option value="wx">无锡</option>
          <option value="sz">苏州</option>
        </select>
      </p>

      <button type="button" name="submitBtn">提交</button>
    </form>
    <script>
      const f1 = document.f1;
      f1.submitBtn.onclick = function () {
        // 获取 当前选中项（option）的value值
        // console.log(f1.city.value);
        // 设置  设置选项选项value值，选项被选中
        f1.city.value = "sh";
      };
    </script>
  </body>
</html>
